package com.duoec.dw.lineage.dto;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * 脚本的血缘关系解析结果
 *
 * @author xuwenzhen
 */
public class ScriptLineageDto implements Serializable {
    /**
     * 血缘关系
     */
    private List<TableLineageDto> lineages;

    /**
     * 报警信息
     *
     * @demo ["脚本没有写说明", "脚本命名不规范"]
     */
    private List<String> warningList;

    /**
     * 错误信息
     *
     * @demo ["脚本未结束", "脚本讲法错误.."]
     */
    private List<String> errorList;

    /**
     * 脚本变量
     *
     * @demo ["dt", "dt_sub_7"]
     */
    private Set<String> vars;

    /**
     * 依赖的自定义函数
     *
     * @demo ["hdfs:/edw/util/HiveUdf-1.0.jar"]
     */
    private Set<String> jars;

    /**
     * 获取第一个血缘关系
     *
     * @return 血缘关系数据
     */
    public TableLineageDto getFirstLineage() {
        if (lineages == null || lineages.isEmpty()) {
            return null;
        }
        return lineages.get(0);
    }

    public List<TableLineageDto> getLineages() {
        return lineages;
    }

    public void setLineages(List<TableLineageDto> lineages) {
        this.lineages = lineages;
    }

    public List<String> getWarningList() {
        return warningList;
    }

    public void setWarningList(List<String> warningList) {
        this.warningList = warningList;
    }

    public List<String> getErrorList() {
        return errorList;
    }

    public void setErrorList(List<String> errorList) {
        this.errorList = errorList;
    }

    public Set<String> getVars() {
        return vars;
    }

    public void setVars(Set<String> vars) {
        this.vars = vars;
    }

    public Set<String> getJars() {
        return jars;
    }

    public void setJars(Set<String> jars) {
        this.jars = jars;
    }
}
